package newapp.dob.com.dc_new_app.api.bean;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.List;

import newapp.dob.com.dc_new_app.api.ResponseModel;

/**
 * Created by xsooy-pc on 2017/8/24.
 */

public class OrderListModel extends ResponseModel implements Parcelable {

//    {
//        "code": "000",   //状态码：000 表示成功、其他代码则是失败，详情见附件一
//            "msg": "成功",
//            "data": {
//        "lists": [
//        {
//            "id": "1083",  //记录ID
//                "notice_sn": "RB2017082809232568677",   //订单号
//                "order_money": "460.00",  //订单金额
//                "money": "460.00",        //实际支付金额
//                "real_name": "卢建昌",   //用户姓名
//                "payment_account": "alipaymimi@alipay.com"   //支付账号
//            "photo": null,   //上传的支付凭证
//                "create_time": "1503854605",  //订单创建时间
//                "pay_time": "0",  //支付时间
//                "order_id": "0",
//                "is_paid": "0",  //是否已支付：0-否，1-是
//                "user_id": "365",  //所属用户
//                "payment_id": "5",   //支付渠道ID
//                "memo": "",  //备注
//                "outer_notice_sn": "0",   //线下支付相关的订单号
//                "offset_money": "90.00",  //余额抵扣金额
//                "coupon_money": "0.00",  //优惠劵金额
//        }
//        ],
//        "page": {
//            "current_page": 1,   //当前页码
//                    "last_page": 531,   //最后一页页码
//                    "per_page": 2,  //每页显示记录数
//                    "total": 1062   //总记录数
//        }
//    }
//    }


    /**
     * code : 000
     * msg : 成功
     * data : {"lists":[{"id":"1083","notice_sn":"RB2017082809232568677","order_money":"460.00","money":"460.00","real_name":"卢建昌","payment_account":"alipaymimi@alipay.com","photo":"","create_time":"1503854605","pay_time":"0","order_id":"0","is_paid":"0","user_id":"365","payment_id":"5","memo":"","outer_notice_sn":"0","offset_money":"90.00","coupon_money":"0.00"}],"page":{"current_page":1,"last_page":531,"per_page":2,"total":1062}}
     */

    public DataBean data;

    public static class DataBean implements Parcelable {
        /**
         * lists : [{"id":"1083","notice_sn":"RB2017082809232568677","order_money":"460.00","money":"460.00","real_name":"卢建昌","payment_account":"alipaymimi@alipay.com","photo":"","create_time":"1503854605","pay_time":"0","order_id":"0","is_paid":"0","user_id":"365","payment_id":"5","memo":"","outer_notice_sn":"0","offset_money":"90.00","coupon_money":"0.00"}]
         * page : {"current_page":1,"last_page":531,"per_page":2,"total":1062}
         */

        public PageBean page;
        public List<ListsBean> lists;

        public static class PageBean implements Parcelable {
            /**
             * current_page : 1
             * last_page : 531
             * per_page : 2
             * total : 1062
             */

            public int current_page;
            public int last_page;
            public int per_page;
            public int total;

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeInt(this.current_page);
                dest.writeInt(this.last_page);
                dest.writeInt(this.per_page);
                dest.writeInt(this.total);
            }

            public PageBean() {
            }

            protected PageBean(Parcel in) {
                this.current_page = in.readInt();
                this.last_page = in.readInt();
                this.per_page = in.readInt();
                this.total = in.readInt();
            }

            public static final Creator<PageBean> CREATOR = new Creator<PageBean>() {
                @Override
                public PageBean createFromParcel(Parcel source) {
                    return new PageBean(source);
                }

                @Override
                public PageBean[] newArray(int size) {
                    return new PageBean[size];
                }
            };
        }

        public static class ListsBean implements Parcelable {
            /**
             * id : 1083
             * notice_sn : RB2017082809232568677
             * order_money : 460.00
             * money : 460.00
             * real_name : 卢建昌
             * payment_account : alipaymimi@alipay.com
             * photo :
             * create_time : 1503854605
             * pay_time : 0
             * order_id : 0
             * is_paid : 0
             * user_id : 365
             * payment_id : 5
             * memo :
             * outer_notice_sn : 0
             * offset_money : 90.00
             * coupon_money : 0.00
             */

            public String id;
            public String notice_sn;
            public String order_money;
            public String money;
            public String real_name;
            public String payment_account;
            public String photo;
            public String alipay;
            public String u_alipay;
            public long create_time;
            public String pay_time;
            public String order_id;
            public String is_paid;
            public String user_id;
            public String payment_id;
            public String memo;
            public String outer_notice_sn;
            public String offset_money;
            public String coupon_money;
            public String is_failed;
            public String failed_reason;
            public String repay_money;

            @Override
            public int describeContents() {
                return 0;
            }

            @Override
            public void writeToParcel(Parcel dest, int flags) {
                dest.writeString(this.id);
                dest.writeString(this.notice_sn);
                dest.writeString(this.order_money);
                dest.writeString(this.money);
                dest.writeString(this.real_name);
                dest.writeString(this.payment_account);
                dest.writeString(this.photo);
                dest.writeString(this.alipay);
                dest.writeString(this.u_alipay);
                dest.writeLong(this.create_time);
                dest.writeString(this.pay_time);
                dest.writeString(this.order_id);
                dest.writeString(this.is_paid);
                dest.writeString(this.user_id);
                dest.writeString(this.payment_id);
                dest.writeString(this.memo);
                dest.writeString(this.outer_notice_sn);
                dest.writeString(this.offset_money);
                dest.writeString(this.coupon_money);
                dest.writeString(this.is_failed);
                dest.writeString(this.failed_reason);
                dest.writeString(this.repay_money);
            }

            public ListsBean() {
            }

            protected ListsBean(Parcel in) {
                this.id = in.readString();
                this.notice_sn = in.readString();
                this.order_money = in.readString();
                this.money = in.readString();
                this.real_name = in.readString();
                this.payment_account = in.readString();
                this.photo = in.readString();
                this.alipay = in.readString();
                this.u_alipay = in.readString();
                this.create_time = in.readLong();
                this.pay_time = in.readString();
                this.order_id = in.readString();
                this.is_paid = in.readString();
                this.user_id = in.readString();
                this.payment_id = in.readString();
                this.memo = in.readString();
                this.outer_notice_sn = in.readString();
                this.offset_money = in.readString();
                this.coupon_money = in.readString();
                this.is_failed = in.readString();
                this.failed_reason = in.readString();
                this.repay_money = in.readString();
            }

            public static final Creator<ListsBean> CREATOR = new Creator<ListsBean>() {
                @Override
                public ListsBean createFromParcel(Parcel source) {
                    return new ListsBean(source);
                }

                @Override
                public ListsBean[] newArray(int size) {
                    return new ListsBean[size];
                }
            };
        }

        @Override
        public int describeContents() {
            return 0;
        }

        @Override
        public void writeToParcel(Parcel dest, int flags) {
            dest.writeParcelable(this.page, flags);
            dest.writeTypedList(this.lists);
        }

        public DataBean() {
        }

        protected DataBean(Parcel in) {
            this.page = in.readParcelable(PageBean.class.getClassLoader());
            this.lists = in.createTypedArrayList(ListsBean.CREATOR);
        }

        public static final Parcelable.Creator<DataBean> CREATOR = new Parcelable.Creator<DataBean>() {
            @Override
            public DataBean createFromParcel(Parcel source) {
                return new DataBean(source);
            }

            @Override
            public DataBean[] newArray(int size) {
                return new DataBean[size];
            }
        };
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.data, flags);
    }

    public OrderListModel() {
    }

    protected OrderListModel(Parcel in) {
        this.data = in.readParcelable(DataBean.class.getClassLoader());
    }

    public static final Parcelable.Creator<OrderListModel> CREATOR = new Parcelable.Creator<OrderListModel>() {
        @Override
        public OrderListModel createFromParcel(Parcel source) {
            return new OrderListModel(source);
        }

        @Override
        public OrderListModel[] newArray(int size) {
            return new OrderListModel[size];
        }
    };
}
